package com.ltmonitor.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name="newAlarm")
@org.hibernate.annotations.Proxy(lazy = false)
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) 
public class Alarm  extends TenantEntity{
	
	public Alarm()
	{
		setCreateDate(new java.util.Date());
	}
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	private long entityId;
	/*
	 * 车辆Id
	 */
	private long vehicleId;
	/**
	 * adas报警唯一编号，系统生成的32字节的UUID，确保可以跟踪到详细的adas报警信息
	 */
	private String adasAlarmNo;
	
	private String alarmIndex;
	
	public long getEntityId() {
		return entityId;
	}
	public void setEntityId(long entityId) {
		this.entityId = entityId;
	}
	private String plateNo;

	private String simNo;
	//报警类型
	private String alarmType;
	//报警描述
	private String descr;
	//报警来源
	private String alarmSource;
	//报警时间
	private Date alarmTime;
	//车速
	private double speed;
	//报警地点
	private String location;
	
	private double latitude;
	
	private double longitude;
	//处理时间
	private Date processedTime;
	//处理用户Id
	private long processedUserId;
	//报警的库表名称，用于ibatis插入时设置的动态库表名称
	@Transient
	private String tableName;

	@Transient
	private long depId;
	
	public Date getProcessedTime() {
		return processedTime;
	}
	public void setProcessedTime(Date processedTime) {
		this.processedTime = processedTime;
	}
	public long getProcessedUserId() {
		return processedUserId;
	}
	public void setProcessedUserId(long processedUserId) {
		this.processedUserId = processedUserId;
	}
	public String getProcessedUserName() {
		return processedUserName;
	}
	public void setProcessedUserName(String processedUserName) {
		this.processedUserName = processedUserName;
	}
	private String processedUserName;
	
	public int getAckSn() {
		return ackSn;
	}
	public void setAckSn(int ackSn) {
		this.ackSn = ackSn;
	}
	public int getProcessed() {
		return processed;
	}
	public void setProcessed(int processed) {
		this.processed = processed;
	}
	//对应终端消息的流水号
	private int ackSn;
	//处理标志
	private int processed;
	
	public long getVehicleId() {
		return vehicleId;
	}
	public void setVehicleId(long vehicleId) {
		this.vehicleId = vehicleId;
	}
	public String getPlateNo() {
		return plateNo;
	}
	public void setPlateNo(String plateNo) {
		this.plateNo = plateNo;
	}
	
	public String getAlarmType() {
		return alarmType;
	}
	public void setAlarmType(String alarmType) {
		this.alarmType = alarmType;
	}
	public String getDescr() {
		return descr;
	}
	public void setDescr(String descr) {
		this.descr = descr;
	}
	public String getAlarmSource() {
		return alarmSource;
	}
	public void setAlarmSource(String alarmSource) {
		this.alarmSource = alarmSource;
	}
	public Date getAlarmTime() {
		return alarmTime;
	}
	public void setAlarmTime(Date alarmTime) {
		this.alarmTime = alarmTime;
	}
	public double getSpeed() {
		return speed;
	}
	public void setSpeed(double speed) {
		this.speed = speed;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public double getLatitude() {
		return latitude;
	}
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}
	public String getTableName() {
		return tableName;
	}
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}


	public long getDepId() {
		return depId;
	}

	public void setDepId(long depId) {
		this.depId = depId;
	}

	public String getSimNo() {
		return simNo;
	}

	public void setSimNo(String simNo) {
		this.simNo = simNo;
	}

	public String getAdasAlarmNo() {
		return adasAlarmNo;
	}

	public void setAdasAlarmNo(String adasAlarmNo) {
		this.adasAlarmNo = adasAlarmNo;
	}
	
	public String getAlarmIndex() {
		return alarmIndex;
	}
	public void setAlarmIndex(String alarmIndex) {
		this.alarmIndex = alarmIndex;
	}
	@Override
	public String toString() {
		return "Alarm [entityId=" + entityId + ", vehicleId=" + vehicleId + ", adasAlarmNo=" + adasAlarmNo
				+ ", alarmIndex=" + alarmIndex + ", plateNo=" + plateNo + ", simNo=" + simNo + ", alarmType="
				+ alarmType + ", descr=" + descr + ", alarmSource=" + alarmSource + ", alarmTime=" + alarmTime
				+ ", speed=" + speed + ", location=" + location + ", latitude=" + latitude + ", longitude=" + longitude
				+ ", processedTime=" + processedTime + ", processedUserId=" + processedUserId + ", tableName="
				+ tableName + ", depId=" + depId + ", processedUserName=" + processedUserName + ", ackSn=" + ackSn
				+ ", processed=" + processed + "]";
	}
}
